﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SzCourt.Logic.BLL;
using KMFrame.Core;

namespace SzCourt.WebSite.shenwu
{
    public partial class cpws : System.Web.UI.Page
    {
        public int PageIndex = 1;
        public int PageSize = 10;
        public int TotalPage = 1;       
        private string CaseClass = string.Empty;
        private string CaseName = string.Empty;
        //private string CaseYear = string.Empty;
        //private string CaseWord = string.Empty;
        //private string CaseNum = string.Empty;
        private string CaseContent = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            getList();
        }

        private void getList()
        {
            this.PageIndex = string.IsNullOrEmpty(Request.QueryString["PageIndex"]) ? 1 : Convert.ToInt32(Request.QueryString["PageIndex"]);
            this.CaseContent = string.IsNullOrEmpty(Request.QueryString["CaseContent"]) ? "" : Request.QueryString["CaseContent"];
            this.CaseClass = string.IsNullOrEmpty(Request.QueryString["CaseClass"]) ? "" : Request.QueryString["CaseClass"];
            this.CaseName = string.IsNullOrEmpty(Request.QueryString["CaseName"]) ? "" : Request.QueryString["CaseName"];
            //this.CaseYear = string.IsNullOrEmpty(Request.QueryString["CaseYear"]) ? "" : Request.QueryString["CaseYear"];
            //this.CaseWord = string.IsNullOrEmpty(Request.QueryString["CaseWord"]) ? "" : Request.QueryString["CaseWord"];
            //this.CaseNum = string.IsNullOrEmpty(Request.QueryString["CaseNum"]) ? "" : Request.QueryString["CaseNum"];
            
            
            RfDocCondition param = new RfDocCondition();
            param.PageIndex = this.PageIndex;
            param.PageSize = this.PageSize;
            param.CaseClass = this.CaseClass;
            if (!string.IsNullOrEmpty(this.CaseContent))
            {
                param.CaseContent = this.CaseContent;
            }
            if (!string.IsNullOrEmpty(this.CaseName))
            {
                param.CaseName = this.CaseName;
            }
            //if (this.CaseWord.Length > 0)
            //{
            //    param.CaseWord = this.CaseWord;
            //}

            //if (this.CaseYear.Length > 0)
            //{
            //    param.CaseYear = this.CaseYear;
            //}

            //if (this.CaseNum.Length > 0)
            //{
            //    param.CaseNum = this.CaseNum;
            //}

            RefereeDoc art = new RefereeDoc();
            PageResult result = (PageResult)art.GetRefereeDocPage(param);

            if (result != null)
            {
                this.rptDataList.DataSource = result.ResultList;
                this.rptDataList.DataBind();

                this.pager1.RecordCount = result.TotalCount; 
                this.pager1.TotalPage = result.PageCount;
                this.pager1.PageIndex = this.PageIndex;
                this.pager1.PageSize = this.PageSize;
                this.pager1.LinkUrl = "/shenwu/cpws.aspx?PageIndex=" + this.PageIndex.ToString();
                this.pager1.IsResult = false;
                this.pager1.IsNext = "2";
            }


        }
    }
}